package cn.iocoder.yudao.framework.pay.core.client.impl.pax;

import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO;
import cn.iocoder.yudao.framework.pay.core.client.impl.pax.enums.DeviceTypeEnum;
import cn.iocoder.yudao.framework.pay.core.client.impl.pax.enums.PayMethodEnum;
import cn.iocoder.yudao.framework.pay.core.client.impl.pax.enums.TerminalTypeEnum;
import cn.iocoder.yudao.framework.pay.core.client.impl.pax.model.PaxCreatePrePayOrderRequest;

/**
 * @author cai
 * @date 2024/05/07 12:38
 */
public class PaxAppClient extends AbstractPaxClient {

    public PaxAppClient(Long channelId, String channelCode, PaxClientConfig config) {
        super(channelId, channelCode, config);
    }

    @Override
    protected void buildCreatePrePayOrderRequest(PayOrderUnifiedReqDTO reqDTO, PaxCreatePrePayOrderRequest request) {
        super.buildCreatePrePayOrderRequest(reqDTO, request);
        request.setPayMethod(PayMethodEnum.CALL_PAY.getValue());
        request.setTerminalType(TerminalTypeEnum.APP.getValue());
        request.getDeviceInfo().setDeviceType(DeviceTypeEnum.PHONE.getValue());
    }
}
